<template>
  <div>
      <button @click="add">点我给你直接+1</button>
      <span>我就是答案：{{$store.state.n}}</span>
      <button @click="reduce1">点我直接给你-1</button>
      <div></div>
  </div>
</template>

<script>
export default {
data() {
  return {
      // n:0
  }
},
 methods: {
   add(){
      this.$store.dispatch('jia')
   },
   reduce1(){
     this.$store.dispatch('jian')
   }
 },
}
</script>

<style scoped lang="less">
div{
  font-size: 20px;
}
</style>